﻿//-----------------------------------------------------------------------
// <copyright file="ServerHelpers.cs" company="None">
// None
// </copyright>
//-----------------------------------------------------------------------
namespace SampleDataService
{
    using System;
    using System.Collections.Generic;
    using System.Data.Services;
    using System.Data.Services.Common;
    using System.Linq;
    using System.ServiceModel.Web;
    using System.Web;
    using WCFDataServiceFormatExtensions;

    [EnableTextOutputAttribute]
    public class WCFDataService : DataService<NORTHWNDEntities>
    {
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
            // Examples:
            config.SetEntitySetPageSize("*", 2);
            config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
        }
    }
}
